<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8" />
		<title>组织表单</title>
		<div th:replace="common/common_form_header"></div>
	</head>
	<style>
		::-webkit-scrollbar{
		    width:4px;
		}
		  ::-webkit-scrollbar-thumb {
			background: rgba(0,0,0,0.1);
		}
		.addemployee-wrap{
			width:100%;
			height:100%;
			padding: 0px 0px 10px 0px;
			box-sizing: border-box;
		}
		.form-wrap{
			width: 100%;
		    padding: 30px 30px 10px 0px;;
		    height: 100%;
		    overflow-y: scroll;
		    box-sizing: border-box;
		}
	</style>
	<body>
		<div class="addemployee-wrap" id="employee-wrap">
			<div class="form-wrap" >
    			<form  class="layui-form" id="defaultForm" th:method="post" th:action="@{/app/projectBuilding/update}">
    				<input type="hidden" id=id name="id" th:value="${record.id}"/>
    				<input type="hidden" id="fkProject" name="fkProject" th:value="${record.fkProject}"/>
					<div class="layui-form-item">
					    <label class="layui-form-label"><span class="must-fill">*</span>大楼名</label>
					    <div class="layui-input-block">
						    <input type="text" name="buildingName" id="buildingName" required th:value="${record.buildingName}" lay-verify="buildingName" class="layui-input"  placeholder="">
						</div>
					</div>
					<div class="layui-form-item" style="position: fixed;">
					    <div class="layui-input-block">
					      <button class="layui-btn layui-btn-normal" lay-submit lay-filter="formEmployee" id="submit-btn">确定</button>
					      <a class="layui-btn layui-btn-primary" onclick="closeLayer()">取消</a>
					    </div>
					</div>
				</form>
    		</div>
    	</div>
	</body>
	<script>
	layui.config({
	        base: '/js/plugin/layui-v2.3.0/layui/' //此处路径请自行处理, 可以使用绝对路径
	    }).extend({
	        formSelects: 'formSelects-v3'
	    }).use(['element',"layer","form",'formSelects'], function(){
			var layer=layui.layer,form = layui.form,formSelects = layui.formSelects;
			
			form.verify({
				buildingName: function(value, item){ //value：表单的值、item：表单的DOM对象
		      	  	if(value==""){
			       		  return '大楼名不能为空';
			      	}
			  	}
			}); 
			//监听提交
			form.on('submit(formEmployee)', function(data){
				$.post($("#defaultForm").attr('action'), data.field, function(result) {
					window.parent.layer.msg(result.msg);
					closeLayer();
				}, 'json');
				return false;
			});
		});
	
</script>
</html>